<script setup>
defineProps({
    control: Object,
    model: Object,
})
</script>

<template>
    <van-field
        :name="control.id"
        v-model="model[control.id]"
        :label="control.props.label"
        :placeholder="control.props.placeholder"
        :type="control.props.type"
        :show-word-limit="control.props.showWordLimit"
        :maxlength="control.props.showWordLimit ? control.props.maxlength : undefined"
        :clearable="control.props.clearable"
        :disabled="control.props.disabled"
        :readonly="control.props.readonly"
        :rules="control.rules"
        :required="control.rules[0].required"
    />
</template>
